<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="/js/axios.min.js"></script>
    <script src="/js/query.js"></script>
    <script>
        window.onload=function (){
            var info=getQuery("errorInfo");
            if (info!=null&&info=="noError"){
                $("errorDiv").innerHTML="对不起，请先登录";
            }
        }
        function land(){
            axios.get("/user/login",{
                params:{
                    userName:$("userName").value,
                    pwd:$("pwd").value,
                }
            }).then(resp=>{
                var  info= resp.data;
                if (info=="ok"){
                    location.href="/index.html";
                }else {
                    $("errorDiv").innerHTML="账号或者密码错误";
                }
            })
        }
    </script>
</head>
<body>
<div id="errorDiv" style="color: red"></div>
账号:<input type="text" id="userName"><br>
密码:<input type="text" id="pwd"><br>
<input type="button" value="登录" onclick="land()">
</body>
</html>